<template>
  <view class="b">
    <view>
      <view class="title">{{ newsDetails?.title || "12312" }}</view>
      <view class="date">
        <!-- <view> 浏览量：{{ newsDetails?.browseNumber }} </view> -->
        {{ dayjs(newsDetails?.gmtCreate).format("YYYY-MM-DD") }}
      </view>
      <view class="des">
        <u-parse :content="newsDetails?.content"></u-parse>
      </view>
    </view>
  </view>
</template>

<script setup lang="ts">
import { onBeforeMount, ref } from "vue";
import dayjs from "dayjs";
import { selectInfo } from "@/api/home";
const newsDetails = ref();
const { id } = defineProps<{
  id: string;
}>();
onBeforeMount(async () => {
  const res = await selectInfo({ id: id });
  newsDetails.value = res.data;
});
</script>

<style lang="less" scoped>
.b {
  background: #fff;
  min-height: 93vh;
  padding: 25rpx;
}
.title {
  font-size: 48rpx;
  font-weight: bold;
  color: #1e1e1e;
}
.date {
  font-size: 30rpx;
  color: #bebebe;
  line-height: 40rpx;
  margin-top: 24rpx;
  margin-bottom: 34rpx;
  display: flex;
  justify-content: space-between;
}
.des {
  white-space: pre-wrap;
  width: 100%;
  img {
    width: 100%;
    height: 100%;
  }
}
.img {
  width: 100%;
  margin-top: 22rpx;
}
</style>
